<!-- head -->
{include file='public/head' /}
<!-- head -->

<!-- left -->
{include file='public/left' /}
<!-- left -->

<div class="content-wrapper">
    <section class="content-header">
        <h1>
            用户列表
            <small>全部用户</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> 人员管理</a></li>
            <li class="active">用户列表</li>
        </ol>
    </section>

    <section class="content">
        <div class="row">
            <div class="col-sm-12">
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title" style="font-size: 14px;">共计{$customList->total()}条记录</h3>
                        <div class="box-tools pull-right">
                            <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                            </button>
                            <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
                        </div>
                    </div>
                    <div class="box-body">
                        <div class="table-responsive">
                            <table class="table table-bordered table-striped">
                                <form id='iform' action="{:url('Custom/customlist')}" method="get">
                                    <div class="input-group">
                                        <input type="text" name="custom_phone" value="{$custom_phone}" class="form-control" style="width: 47%; margin-right: 3%" placeholder="请输入手机号...">
                                        <input type="text" name="custom_name" value="{$custom_name}" class="form-control" style="width: 47%; margin-right: 3%" placeholder="请输入姓名...">

                                        <span class="input-group-btn">
                                            <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
                                            </button>
                                        </span>
                                    </div>
                                </form>
                                <thead>
                                    <tr>
                                        <th>编号</th>
                                        <th>店铺名称</th>
                                        <th>姓名</th>
                                        <th>电话</th>
                                        <th>客户类型</th>
                                        <th>进店次数</th>
                                        <th>访问次数</th>
                                        <th>注册时间</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {volist name='aa' id='admin'}
                                    <tr>
                                        <td>{$admin.id}</td>
                                        <td>{$admin.storeinfo.store_name}</td>
                                        <td>
                                            {if condition="$admin.real_name neq ''"}{$admin.real_name}
                                            {elseif condition="$admin.custom_name neq ''"/}{$admin.custom_name}
                                            {elseif condition="$admin.custom_phone neq ''"/}{$admin.custom_phone}
                                            {/if}
                                        </td>
                                        <td>
                                            <a href ="javascript:volid(0);" style="text-decoration: none;color: #000000;" title="{$admin.custom_phone}" target='_blank' class="ord_phone">{$admin.custom_phone}</a>
                                        </td>
                                        <td>
                                            {if condition="$admin.vip_status eq 0"}访客用户 
                                            {elseif condition="$admin.vip_status eq 1"/}普通用户
                                            {elseif condition="$admin.vip_status eq 2"/}vip用户
                                            {/if}
                                        </td>
                                        <td>{$admin.service_count}</td>
                                        <td>{$admin.visit_count}</td>
                                        <td>{$admin.add_time|date='Y-m-d H:i',###}</td>
                                        <td style="width: 100px; text-align:right;">
                                            <button type="button" class="btn btn-sm bg-olive" data-url="{:url('admin/Custom/ShowMessage',['id'=>$admin.id],'')}" onclick="ShowMessage(this)">查看信息 </button>&nbsp;
                                        </td>
                                    </tr>
                                    {/volist}
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="box-footer clearfix" style="text-align: center">
                        {$customList->render()}
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
<script type="text/javascript">
    function ShowMessage(obj) {
        var url = $(obj).data('url');
        window.location.href = url;
    }
    
    $(function () {
        var ord_phone = $(".ord_phone");
        for (var i = 0; i < ord_phone.length; i++) {
            var cnd = $(".ord_phone").eq(i).text();
            var mpcnd = cnd.substr(0, 3) + '****' + cnd.substr(7);
            $(".ord_phone").eq(i).text(mpcnd);
        }

    });

</script>

<!-- foot -->
{include file='public/foot' /}
<!-- foot -->